<?php

include $_SERVER['DOCUMENT_ROOT']."/lib/start.php";

check_session();
check_permission(ADM_PERM);

header("Content-type: text/plain");

$res_string = "";
$sel_classi = "SELECT id_classe, anno_corso, sezione FROM classi ORDER BY sezione, anno_corso";
try{
	$res_classi = $db->executeQuery($sel_classi);
} catch (MySQLException $ex){
	print "ko";
	exit;
}
while($cls = $res_classi->fetch_assoc()){
	$res_string .= $cls['id_classe']."#".$cls['anno_corso'].$cls['sezione'].";";
}
$output = preg_replace("/;$/", "", $res_string);
print $output;
exit;

?>